package org.batatasframework.strategy;

import javax.servlet.ServletException;

import cn.bonoon.kernel.util.ItemSortable;
import cn.bonoon.kernel.util.MD5Util;

public abstract class AbstractServiceStrategyHandler extends ItemSortable implements ServerStrategyHandler{
	
	protected AbstractServiceStrategyHandler(String id, String name){
		this.id = id;
		this.name = name;
	}
	
	protected AbstractServiceStrategyHandler(){
		this.id = MD5Util.randomMD5String();
	}
	
	@Override
	public void setId(String id) {
		throw new RuntimeException("不允许对ID进行set值！");
	}
	
	/** 允许子类进行初始化处理 */
	public void init() throws ServletException{}
	
//	
//	@Override
//	public int getOrdinal() {
//		return ordinal;
//	}
//	
//	public void setOrdinal(int ordinal) {
//		this.ordinal = ordinal;
//	}
//
//	@Override
//	public String getName() {
//		return name;
//	}
//
//	public String getId() {
//		return id;
//	}
}
